<template>
  <div class="shouhuoqidong">
			<van-sticky>
			  <van-nav-bar class="navBar" title="工具选择" left-arrow @click-left="$router.go(-1)"></van-nav-bar>
			</van-sticky>

			<van-notice-bar color="#1989fa" background="#ecf9ff" left-icon="info-o">
			  请选择使用工具类型
			</van-notice-bar>

			<div class="gongjuWarp">
				<van-grid  :column-num="2" >
				  <van-grid-item icon="@/../static/img/chache.png" text="高叉车7层" @click="GaoCar()"/>
				  <van-grid-item icon="@/../static/img/pingchache.png" text="平叉车1层" @click="pingCar()" />
				  <van-grid-item icon="@/../static/img/gouwuchey.png" text="高位拣货车3层" @click="GaoWei()"/>
				  <van-grid-item icon="@/../static/img/qitache.png" text="其他4层及以下" @click="qita()"/>
				</van-grid>
			</div>


  </div>
</template>

<script>

export default {
  name: 'gongju',
  components: {

  },
  data() {
    return {
		};
  },
  methods: {
		GaoCar(){
			 var _self = this;
			 var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			 this.MYPOST({
					'method':'dgate',
					'pname':'f_wmsa_y_jianhuo',
					'i':this.FNULLE([
						'opmode','GJXZ_ccxg',
						'kqid', this.ryuser.kqid,
						'gi_cha_che_level','7',
						'czyid',this.ryuser.operatorid,
					])
					}, '高叉车',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
					if(ret_iserr){ //传入的true参数,理论上不会有此回调了
						_self.$toast.fail('查询失败')
						_self.$store.commit('hideLoading');
					}else{
						var rtn_json_obj = null;
						_self.$store.commit('hideLoading');
						if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
						}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
						}

						console.log("高叉车")
						console.log(rtn_json_obj)
						if(rtn_json_obj[0].ret_ret == '0'){
								_self.$dialog.alert({title: '提示',message: rtn_json_obj[0].ret_mess,})
							 // _self.$notify({ type: 'success', message: rtn_json_obj[0].ret_mess});
							// _self.$toast.fail(rtn_json_obj[0].ret_mess)
						}
					}
			 });
		},
		pingCar(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_jianhuo',
				'i':this.FNULLE([
					'opmode','GJXZ_ccxg',
					'kqid', this.ryuser.kqid,
					'gi_cha_che_level','1',
					'czyid',this.ryuser.operatorid,
				])
				}, '平叉车',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}

					console.log("平叉车")
					console.log(rtn_json_obj)
					if(rtn_json_obj[0].ret_ret == '0'){
							_self.$dialog.alert({title: '提示',message: rtn_json_obj[0].ret_mess,})
						 // _self.$notify({ type: 'success', message: rtn_json_obj[0].ret_mess});
					}
				}
			});
		},
		GaoWei(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_jianhuo',
				'i':this.FNULLE([
					'opmode','GJXZ_ccxg',
					'kqid', this.ryuser.kqid,
					'gi_cha_che_level','3',
					'czyid',this.ryuser.operatorid,
				])
				}, '高位拣货车',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}

					console.log("高位拣货车")
					console.log(rtn_json_obj)
					if(rtn_json_obj[0].ret_ret == '0'){
						_self.$dialog.alert({title: '提示',message: rtn_json_obj[0].ret_mess,})
					 // _self.$notify({ type: 'success', message: rtn_json_obj[0].ret_mess});
					}
				}
			});
		},
		qita(){
			var _self = this;
			var ldemodata = [{retval:0, errmsg:'返回数据集'},]
			this.MYPOST({
				'method':'dgate',
				'pname':'f_wmsa_y_jianhuo',
				'i':this.FNULLE([
					'opmode','GJXZ_ccxg',
					'kqid', this.ryuser.kqid,
					'gi_cha_che_level','4',
					'czyid',this.ryuser.operatorid,
				])
				}, '其他',true, ldemodata, function(ret_obj, ret_iserr,ret_errmess,ret_oldresp){
				if(ret_iserr){ //传入的true参数,理论上不会有此回调了
					_self.$toast.fail('查询失败')
					_self.$store.commit('hideLoading');
				}else{
					var rtn_json_obj = null;
					_self.$store.commit('hideLoading');
					if(ret_obj != null){ rtn_json_obj = ret_obj; //返回的接口可以直接解析的情况
					}else{  rtn_json_obj = _self.arr2Obj(ret_oldresp.data); //非标准的dgate接口,返回的一个不兼容的处理
					}

					console.log("其他")
					console.log(rtn_json_obj)
					if(rtn_json_obj[0].ret_ret == '0'){
							_self.$dialog.alert({title: '提示',message: rtn_json_obj[0].ret_mess,})
						 // _self.$notify({ type: 'success', message: rtn_json_obj[0].ret_mess});
					}
				}
			});
		},
  },
  mounted() {
    //console.log("-- 可能需要处理功能权限 --");
    var _self = this; var l_hy = this.GWO(true).gUSER;  window.GWO().debug=this;
  },
	computed: {
	   ryuser: function(){
	     return this.GWO(true).gUSER;
	   }
	},
};
</script>

<style lang="scss" scoped>
// 引入公共样式
@import '@/assets/css/base.scss';
.gongjuWarp{
	margin-top: 20px;
	width: 96%;
	margin-left: 2%;
}
</style>
